//
//  UserAgreementViewController.m
//  LiTingFeng
//
//  Created by xinxuan on 16/3/18.
//  Copyright © 2016年 Bullgo. All rights reserved.
//

#import "UserAgreementViewController.h"

@interface UserAgreementViewController ()
@property (nonatomic,strong) UIWebView * webView;
@end

@implementation UserAgreementViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.webView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 0, Screen_Width , Screen_Height)];
    //webView的透明度
    self.webView.backgroundColor = [UIColor whiteColor];
    self.webView.scrollView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:self.webView];
    //开辟子线程加载页面
    dispatch_async(dispatch_get_global_queue(0, 0), ^{
        [self loadDocument:@"paper.pdf" inView:self.webView];
        dispatch_async(dispatch_get_main_queue(), ^{
            
        });
        [self.view reloadInputViews];
    });
    
    
}




-(void)loadDocument:(NSString *)documentName inView:(UIWebView *)webView
{
    NSString *path = [[NSBundle mainBundle] pathForResource:documentName ofType:nil];
    NSURL *url = [NSURL fileURLWithPath:path];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [webView loadRequest:request];
}

-(void)viewWillAppear:(BOOL)animated{
    self.tabBarController.tabBar.hidden = YES;
}


-(void)viewWillDisappear:(BOOL)animated{
    self.tabBarController.tabBar.hidden = NO;
    
}
@end
